package club.lovety.web.controller;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

/**
 * Created by smc on 2018/2/25.
 */
@RestController
@RequestMapping("user")
public class UserController {

    @Resource
    private RestTemplate restTemplate;

    @RequestMapping("username")
    public String getUserName(){
        ResponseEntity<String> content = restTemplate.getForEntity("http://user-service/userinfo/getusername?content={1}",String.class,"hello world");
        return content.getBody();
    }

}
